package com.hula.loan4u.view;


import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;

import com.hula.loan4u.R;
import com.hula.loan4u.base.MBaseRecyclerAdapter;


public class HomeCategoryView extends LinearLayout {

    RecyclerView gridRecyclerView;

    public HomeCategoryView(Context context) {
        this(context, null);
    }

    public HomeCategoryView(Context context, AttributeSet attrs) {
        super(context, attrs);
        LayoutInflater.from(context).inflate(R.layout.layout_home_category, this, true);
        gridRecyclerView = (RecyclerView) findViewById(R.id.gridRecyclerView);
        GridLayoutManager layoutManager = new GridLayoutManager(context, 3);
        gridRecyclerView.setLayoutManager(layoutManager);
        initData();
    }

    private void initData() {
    }

    public void setAdapter(MBaseRecyclerAdapter adAdapter) {
        gridRecyclerView.setAdapter(adAdapter);
    }
}
